package com.admin.system.service;

import java.util.List;

import com.admin.base.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.admin.system.dao.SystemLogMapper;
import com.admin.system.entity.SystemLog;
import com.admin.system.vo.query.SystemLogQuery;

/**
 * 操作相关
 */
@Service
public class SystemLogService {

    @Autowired
    private SystemLogMapper systemLogMapper;

    public SystemLog queryById(Integer id) {
        return systemLogMapper.selectByPrimaryKey(id);
    }

    public List<SystemLog> listByConditions(SystemLogQuery query) {
        return systemLogMapper.listByConditions(query);
    }

    public Long pageCount(SystemLogQuery query) {
        return systemLogMapper.pageCount(query);
    }

    public void add(SystemLog record) {
        systemLogMapper.insertSelective(record);
    }

    public void delete(Integer[] ids) {
        for (Integer id : ids) {
            systemLogMapper.deleteByPrimaryKey(id);
        }
    }

    public void update(SystemLog record) {
        systemLogMapper.updateByPrimaryKeySelective(record);
    }

    public Page<SystemLog> pagingByConditions(SystemLogQuery query) {
        return systemLogMapper.pagingByConditions(query);
    }
}
